//
//  SystemNewsTableViewCell.swift
//  TianTianBiTing
//
//  Created by Gox mac 2 on 2019/3/8.
//  Copyright © 2019 Gox_WallyDiao. All rights reserved.
//

import UIKit

class SystemNewsTableViewCell: UITableViewCell {
    var leftImage:UIImageView = UIImageView()
    var titleLabel:UILabel = UILabel()
    var describeLabel:UILabel = UILabel()
    var timeLabel:UILabel = UILabel()
    var lineView:UIView = UIView()
    
    override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
        super.init(style: style, reuseIdentifier: reuseIdentifier)
        
        setUI()
    }
    
    
    func setUI() {
        leftImage.layer.cornerRadius = 4
        leftImage.layer.masksToBounds = true
        contentView.addSubview(leftImage)

        titleLabel.font = Font_Bold(18)
        titleLabel.textColor = RGB_Same(53)
        contentView.addSubview(titleLabel)
        
        describeLabel.font = Font_Medium(14)
        describeLabel.textColor = RGB_Same(136)
        contentView.addSubview(describeLabel)
        
        timeLabel.font = Font_Medium(11)
        timeLabel.textColor = RGB_Same(136)
        timeLabel.textAlignment = .right
        contentView.addSubview(timeLabel)
        
        lineView.backgroundColor = RGB_Same(240, 1)
        contentView.addSubview(lineView)
        
    }
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    override func awakeFromNib() {
        super.awakeFromNib()
        // Initialization code
    }
    
    override func setSelected(_ selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)
        
        // Configure the view for the selected state
    }
    
    override func layoutSubviews() {
        leftImage.frame = FRAME_CGFloat(10, 34.5, 27, 27)
        titleLabel.frame = FRAME_CGFloat(44.5, 25, SCREEN_WIDTH - 90, 25)
        describeLabel.frame = FRAME_CGFloat(44.5, 54, SCREEN_WIDTH - 60, 20)
        timeLabel.frame = FRAME_CGFloat(SCREEN_WIDTH - 110, 30, 100, 15)
        lineView.frame = FRAME_CGFloat(10, 80.5, SCREEN_WIDTH - 20, 1)
        
    }

}
